This PR is to add comments to UpdateOnUFSChange in pkg/ddc/alluxio/ufs.go.#5797
This PR is to add comments to UpdateOnUFSChange in pkg/ddc/alluxio/ufs.go.#5797morpho327 wants to merge 1 commit intofluid-cloudnative:masterfrom
Conversation
Signed-off-by: morpho327 <2410653591@qq.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @morpho327. Thanks for your PR. I'm waiting for a fluid-cloudnative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
There was a problem hiding this comment.
Code Review
This pull request adds documentation to the UpdateOnUFSChange function in the Alluxio engine. The review feedback suggests refining the documentation for the updateReady return value to improve clarity, correcting the description of when the dataset status is updated, and removing a trailing whitespace.
| // UpdateOnUFSChange handles the updates when the Underlying File System (UFS) changes. | ||
| // It checks if an update is required, sets the dataset status to Updating, and processes | ||
| // the added or removed mount points for the Alluxio engine. | ||
| // | ||
| // Parameters: | ||
| // - ufsToUpdate (*utils.UFSToUpdate): The object containing information about which UFS paths need to be updated. | ||
| // | ||
| // Returns: | ||
| // - updateReady (bool): Indicates whether the update process is ready or completed. | ||
| // - err (error): Returns an error if the status update or UFS processing fails, otherwise returns nil. |
There was a problem hiding this comment.
The documentation for the return value updateReady could be more precise. Currently, it returns false when no update is required, which might be slightly confusing if interpreted as the system not being 'ready'. Additionally, the description of the function's behavior could be clarified to indicate that the status is only set to 'Updating' if an update is actually needed. There is also a trailing whitespace at the end of line 138.
| // UpdateOnUFSChange handles the updates when the Underlying File System (UFS) changes. | |
| // It checks if an update is required, sets the dataset status to Updating, and processes | |
| // the added or removed mount points for the Alluxio engine. | |
| // | |
| // Parameters: | |
| // - ufsToUpdate (*utils.UFSToUpdate): The object containing information about which UFS paths need to be updated. | |
| // | |
| // Returns: | |
| // - updateReady (bool): Indicates whether the update process is ready or completed. | |
| // - err (error): Returns an error if the status update or UFS processing fails, otherwise returns nil. | |
| // UpdateOnUFSChange handles the updates when the Underlying File System (UFS) changes. | |
| // It checks if an update is required, and if so, sets the dataset status to Updating | |
| // and processes the added or removed mount points for the Alluxio engine. | |
| // | |
| // Parameters: | |
| // - ufsToUpdate (*utils.UFSToUpdate): The object containing information about which UFS paths need to be updated. | |
| // | |
| // Returns: | |
| // - updateReady (bool): Returns true if the update was successfully performed, or false if no update was needed or an error occurred. | |
| // - err (error): Returns an error if the status update or UFS processing fails, otherwise returns nil. |
|
/ok-to-test |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5797 +/- ##
=======================================
Coverage 58.46% 58.46%
=======================================
Files 473 473
Lines 32222 32222
=======================================
Hits 18839 18839
Misses 11836 11836
Partials 1547 1547 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cheyang
left a comment
There was a problem hiding this comment.
The comment addition and new Ginkgo tests for webhook controller look good. A few observations:
-
Comment quality — The
UpdateOnUFSChangedoc comment is helpful, clearly describing parameters and return values. -
Test refactoring — Good improvement: replacing
gomonkey.ApplyFuncfor env var mocking withGinkgoT().Setenv()is cleaner and more reliable. -
Suite package change —
mutating_suite_test.gochanged frommutating_testtomutatingpackage. This is correct for Ginkgo v2 (suite file should be in the same package as the tested code).
However, lint (gofmt) check is failing. Please run make fmt or gofmt -w on the changed Go files and push again:
make fmt
git add -A
git commit --amend --no-edit
git push -f
Once lint passes, I'll approve.



Ⅰ. Describe what this PR does
Add notation to the UpdateOnUFSChange function in fluid/pkg/ddc/alluxio/ufs.go.
Ⅱ. Does this pull request fix one issue?
fixes #5796
III. Special notes for reviews